SHELL = /bin/sh  
CC = g++
AR = ar  

CFLAG = -O2 -W -Wall  

INCLUDE_PATH = -I.  
LIB_TARGET = ./DialServicesSDK.a  
PLUS_OBJ = DialServicesSDK.o  
PLUS_SRC = ./DialServicesSDK.cpp  
	
all :clean $(LIB_TARGET) servicesTest clientTest
	@echo "compile success!"
	
DialServicesSDK : $(LIB_TARGET)  
$(PLUS_OBJ): $(PLUS_SRC)  
	$(CC) $(CFLAG) $(INCLUDE_PATH) -c $(PLUS_SRC)
$(LIB_TARGET) : $(PLUS_OBJ)
	$(AR) cq $@ $^
	
servicesTest:servicesTest.cpp
	g++ -g -o servicesTest servicesTest.cpp DialServicesSDK.a -lmosquitto
clientTest:clientTest.cpp
	g++ -g -o clientTest clientTest.cpp DialServicesSDK.a -lmosquitto

	
clean:  
	rm -f $(PLUS_OBJ)
	rm -f $(LIB_TARGET)
	rm -f servicesTest
	rm -f clientTest